Repository navigation
Reserve run ownership before installing worker deadlines - #31
Draft
mtwilliams wants to merge 1 commit into
Draft
mtwilliams wants to merge 1 commit into
mtwilliams wants to merge 1 commit into
Conversation
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a managed-run ownership race: a duplicate call could expire or lose its caller before reaching native validation, then cancel the legitimate original attempt sharing that control. The caller now atomically reserves the model-bound control before creating a watcher/deadline. Native entry consumes the reservation once; direct internal NIF calls remain one-attempt. Rejected duplicates acquire no cancellation ownership.
The resource is versioned OrtexRunControlV2.
started?/1reports native entry (including mutex waiting), separately from reservation, and a zero-deadline attempt consumes its reservation without launching a worker. Upgrades require a fresh VM.Validation: 218 checks passed on runtimes 1.17.3 and 1.24.4 (two optional ResNet checks excluded). Deterministic regressions cover a zero-deadline duplicate before native entry, wrong-model zero-deadline reuse, and 16 concurrent public reservations with exactly one successful owner. Focused rerun and all-provider/diagnostic-feature cargo check passed. A further 100,000 bounded calls per runtime preserved golden scores, process count 124, and bounded RSS samples (1.17.3: 103.5–105.6 MB; 1.24.4: 108.0–110.1 MB).
Stacked on #30. This closes the ownership window in #28 and completes the combined integration stack. The current combined stack, including this ownership fix, has completed validation below. Fork only. Task commit unsigned because the signing agent cancels requests.
Final combined validation is green at
a4cef8490858d89b7827ef6e62ba652107434373oncodex/ortex-integration:Review in stack order #2–#31. Preserve ancestry with merge commits, or rebase/retarget the remaining stack after squash/rebase merges. The worktree is clean. Fresh VM required for native resource upgrades. No upstream writes, release tags, or Hex publication were performed.